
<!doctype html>
<html lang="en" class="no-js">
  <head>
    
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width,initial-scale=1">
      
      
      
        <link rel="canonical" href="https://athackst.github.io/vscode_ros2_workspace/">
      
      
      
        <link rel="next" href="LICENSE/">
      
      <link rel="icon" href="assets/images/favicon.png">
      <meta name="generator" content="mkdocs-1.4.3, mkdocs-material-9.1.18">
    
    
      
        <title>athackst/vscode_ros2_workspace</title>
      
    
    
      <link rel="stylesheet" href="assets/stylesheets/main.26e3688c.min.css">
      
      

    
    
    
      
        
        
        <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
        <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
        <style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
      
    
    
    <script>__md_scope=new URL(".",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
    
      

    
    
    
  </head>
  
  
    <body dir="ltr">
  
    
    
      <script>var palette=__md_get("__palette");if(palette&&"object"==typeof palette.color)for(var key of Object.keys(palette.color))document.body.setAttribute("data-md-color-"+key,palette.color[key])</script>
    
    <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
    <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
    <label class="md-overlay" for="__drawer"></label>
    <div data-md-component="skip">
      
        
        <a href="#vscode-ros2-workspace-template" class="md-skip">
          Skip to content
        </a>
      
    </div>
    <div data-md-component="announce">
      
    </div>
    
    
      

  

<header class="md-header md-header--shadow" data-md-component="header">
  <nav class="md-header__inner md-grid" aria-label="Header">
    <a href="." title="athackst/vscode_ros2_workspace" class="md-header__button md-logo" aria-label="athackst/vscode_ros2_workspace" data-md-component="logo">
      
  
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg>

    </a>
    <label class="md-header__button md-icon" for="__drawer">
      <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2Z"/></svg>
    </label>
    <div class="md-header__title" data-md-component="header-title">
      <div class="md-header__ellipsis">
        <div class="md-header__topic">
          <span class="md-ellipsis">
            athackst/vscode_ros2_workspace
          </span>
        </div>
        <div class="md-header__topic" data-md-component="header-topic">
          <span class="md-ellipsis">
            
              VSCode ROS2 Workspace Template
            
          </span>
        </div>
      </div>
    </div>
    
    
    
      <label class="md-header__button md-icon" for="__search">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg>
      </label>
      <div class="md-search" data-md-component="search" role="dialog">
  <label class="md-search__overlay" for="__search"></label>
  <div class="md-search__inner" role="search">
    <form class="md-search__form" name="search">
      <input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
      <label class="md-search__icon md-icon" for="__search">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg>
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12Z"/></svg>
      </label>
      <nav class="md-search__options" aria-label="Search">
        
        <button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
          <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41Z"/></svg>
        </button>
      </nav>
      
    </form>
    <div class="md-search__output">
      <div class="md-search__scrollwrap" data-md-scrollfix>
        <div class="md-search-result" data-md-component="search-result">
          <div class="md-search-result__meta">
            Initializing search
          </div>
          <ol class="md-search-result__list" role="presentation"></ol>
        </div>
      </div>
    </div>
  </div>
</div>
    
    
      <div class="md-header__source">
        <a href="https://github.com/athackst/vscode_ros2_workspace" title="Go to repository" class="md-source" data-md-component="source">
  <div class="md-source__icon md-icon">
    
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
  </div>
  <div class="md-source__repository">
    GitHub
  </div>
</a>
      </div>
    
  </nav>
  
</header>
    
    <div class="md-container" data-md-component="container">
      
      
        
          
        
      
      <main class="md-main" data-md-component="main">
        <div class="md-main__inner md-grid">
          
            
              
              <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
                <div class="md-sidebar__scrollwrap">
                  <div class="md-sidebar__inner">
                    


<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
  <label class="md-nav__title" for="__drawer">
    <a href="." title="athackst/vscode_ros2_workspace" class="md-nav__button md-logo" aria-label="athackst/vscode_ros2_workspace" data-md-component="logo">
      
  
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg>

    </a>
    athackst/vscode_ros2_workspace
  </label>
  
    <div class="md-nav__source">
      <a href="https://github.com/athackst/vscode_ros2_workspace" title="Go to repository" class="md-source" data-md-component="source">
  <div class="md-source__icon md-icon">
    
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
  </div>
  <div class="md-source__repository">
    GitHub
  </div>
</a>
    </div>
  
  <ul class="md-nav__list" data-md-scrollfix>
    
      
      
      

  
  
    
  
  
    <li class="md-nav__item md-nav__item--active">
      
      <input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
      
      
        
      
      
        <label class="md-nav__link md-nav__link--active" for="__toc">
          VSCode ROS2 Workspace Template
          <span class="md-nav__icon md-icon"></span>
        </label>
      
      <a href="." class="md-nav__link md-nav__link--active">
        VSCode ROS2 Workspace Template
      </a>
      
        

<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
  
  
  
    
  
  
    <label class="md-nav__title" for="__toc">
      <span class="md-nav__icon md-icon"></span>
      Table of contents
    </label>
    <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
      
        <li class="md-nav__item">
  <a href="#features" class="md-nav__link">
    Features
  </a>
  
    <nav class="md-nav" aria-label="Features">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#style" class="md-nav__link">
    Style
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#tasks" class="md-nav__link">
    Tasks
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#debugging" class="md-nav__link">
    Debugging
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#continuous-integration" class="md-nav__link">
    Continuous Integration
  </a>
  
</li>
        
      </ul>
    </nav>
  
</li>
      
        <li class="md-nav__item">
  <a href="#how-to-use-this-template" class="md-nav__link">
    How to use this template
  </a>
  
    <nav class="md-nav" aria-label="How to use this template">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#prerequisites" class="md-nav__link">
    Prerequisites
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#get-the-template" class="md-nav__link">
    Get the template
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#create-your-repository" class="md-nav__link">
    Create your repository
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#clone-your-repo" class="md-nav__link">
    Clone your repo
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#open-it-in-vscode" class="md-nav__link">
    Open it in vscode
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#update-the-template-with-your-code" class="md-nav__link">
    Update the template with your code
  </a>
  
</li>
        
      </ul>
    </nav>
  
</li>
      
        <li class="md-nav__item">
  <a href="#faq" class="md-nav__link">
    FAQ
  </a>
  
    <nav class="md-nav" aria-label="FAQ">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#wsl2" class="md-nav__link">
    WSL2
  </a>
  
    <nav class="md-nav" aria-label="WSL2">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#the-gui-doesnt-show-up" class="md-nav__link">
    The gui doesn't show up
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#i-want-to-use-vgpu" class="md-nav__link">
    I want to use vGPU
  </a>
  
</li>
        
      </ul>
    </nav>
  
</li>
        
      </ul>
    </nav>
  
</li>
      
    </ul>
  
</nav>
      
    </li>
  

    
      
      
      

  
  
  
    <li class="md-nav__item">
      <a href="LICENSE/" class="md-nav__link">
        LICENSE
      </a>
    </li>
  

    
  </ul>
</nav>
                  </div>
                </div>
              </div>
            
            
              
              <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
                <div class="md-sidebar__scrollwrap">
                  <div class="md-sidebar__inner">
                    

<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
  
  
  
    
  
  
    <label class="md-nav__title" for="__toc">
      <span class="md-nav__icon md-icon"></span>
      Table of contents
    </label>
    <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
      
        <li class="md-nav__item">
  <a href="#features" class="md-nav__link">
    Features
  </a>
  
    <nav class="md-nav" aria-label="Features">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#style" class="md-nav__link">
    Style
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#tasks" class="md-nav__link">
    Tasks
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#debugging" class="md-nav__link">
    Debugging
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#continuous-integration" class="md-nav__link">
    Continuous Integration
  </a>
  
</li>
        
      </ul>
    </nav>
  
</li>
      
        <li class="md-nav__item">
  <a href="#how-to-use-this-template" class="md-nav__link">
    How to use this template
  </a>
  
    <nav class="md-nav" aria-label="How to use this template">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#prerequisites" class="md-nav__link">
    Prerequisites
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#get-the-template" class="md-nav__link">
    Get the template
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#create-your-repository" class="md-nav__link">
    Create your repository
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#clone-your-repo" class="md-nav__link">
    Clone your repo
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#open-it-in-vscode" class="md-nav__link">
    Open it in vscode
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#update-the-template-with-your-code" class="md-nav__link">
    Update the template with your code
  </a>
  
</li>
        
      </ul>
    </nav>
  
</li>
      
        <li class="md-nav__item">
  <a href="#faq" class="md-nav__link">
    FAQ
  </a>
  
    <nav class="md-nav" aria-label="FAQ">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#wsl2" class="md-nav__link">
    WSL2
  </a>
  
    <nav class="md-nav" aria-label="WSL2">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#the-gui-doesnt-show-up" class="md-nav__link">
    The gui doesn't show up
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#i-want-to-use-vgpu" class="md-nav__link">
    I want to use vGPU
  </a>
  
</li>
        
      </ul>
    </nav>
  
</li>
        
      </ul>
    </nav>
  
</li>
      
    </ul>
  
</nav>
                  </div>
                </div>
              </div>
            
          
          
            <div class="md-content" data-md-component="content">
              <article class="md-content__inner md-typeset">
                
                  


<h1 id="vscode-ros2-workspace-template">VSCode ROS2 Workspace Template</h1>
<p>This template will get you set up using ROS2 with VSCode as your IDE.</p>
<p>See <a href="https://www.allisonthackston.com/articles/vscode_docker_ros2.html">how I develop with vscode and ros2</a> for a more in-depth look on how to use this workspace.</p>
<h2 id="features">Features</h2>
<h3 id="style">Style</h3>
<p>ROS2-approved formatters are included in the IDE.  </p>
<ul>
<li><strong>c++</strong> uncrustify; config from <code>ament_uncrustify</code></li>
<li><strong>python</strong> autopep8; vscode settings consistent with the <a href="https://index.ros.org/doc/ros2/Contributing/Code-Style-Language-Versions/">style guide</a></li>
</ul>
<h3 id="tasks">Tasks</h3>
<p>There are many pre-defined tasks, see <a href=".vscode/tasks.json"><code>.vscode/tasks.json</code></a> for a complete listing.  Feel free to adjust them to suit your needs.  </p>
<p>Take a look at <a href="https://www.allisonthackston.com/articles/vscode_tasks.html">how I develop using tasks</a> for an idea on how I use tasks in my development.</p>
<h3 id="debugging">Debugging</h3>
<p>This template sets up debugging for python files, gdb for cpp programs and ROS launch files.  See <a href=".vscode/launch.json"><code>.vscode/launch.json</code></a> for configuration details.</p>
<h3 id="continuous-integration">Continuous Integration</h3>
<p>The template also comes with basic continuous integration set up. See <a href="/.github/workflows/ros.yaml"><code>.github/workflows/ros.yaml</code></a>.</p>
<p>To remove a linter just delete it's name from this line:</p>
<pre><code class="language-yaml">      matrix:
          linter: [cppcheck, cpplint, uncrustify, lint_cmake, xmllint, flake8, pep257]
</code></pre>
<h2 id="how-to-use-this-template">How to use this template</h2>
<h3 id="prerequisites">Prerequisites</h3>
<p>You should already have Docker and VSCode with the remote containers plugin installed on your system.</p>
<ul>
<li><a href="https://docs.docker.com/engine/install/">docker</a></li>
<li><a href="https://code.visualstudio.com/">vscode</a></li>
<li><a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers">vscode remote containers plugin</a></li>
</ul>
<h3 id="get-the-template">Get the template</h3>
<p>Click on "use this template"</p>
<p><img alt="template_use" src="https://user-images.githubusercontent.com/6098197/91331899-43f23b80-e780-11ea-92c8-b4665ce126f1.png" /></p>
<h3 id="create-your-repository">Create your repository</h3>
<p>On the next dialog, name the repository you would like to start and decide if you want all of the branches, or just the latest LTS: humble.</p>
<p><img alt="template_new" src="https://user-images.githubusercontent.com/6098197/91332035-713ee980-e780-11ea-81d3-13b170f568b0.png" /></p>
<p>Github will then create a new repository with the contents of this one in your account.  It grabs the latest changes as "initial commit".</p>
<h3 id="clone-your-repo">Clone your repo</h3>
<p>Now you can clone your repo as normal</p>
<p><img alt="template_download" src="https://user-images.githubusercontent.com/6098197/91332342-e4e0f680-e780-11ea-9525-49b0afa0e4bb.png" /></p>
<h3 id="open-it-in-vscode">Open it in vscode</h3>
<p>Now that you've cloned your repo onto your computer, you can open it in VSCode (File-&gt;Open Folder). </p>
<p>When you open it for the first time, you should see a little popup that asks you if you would like to open it in a container.  Say yes!</p>
<p><img alt="template_vscode" src="https://user-images.githubusercontent.com/6098197/91332551-36898100-e781-11ea-9080-729964373719.png" /></p>
<p>If you don't see the pop-up, click on the little green square in the bottom left corner, which should bring up the container dialog</p>
<p><img alt="template_vscode_bottom" src="https://user-images.githubusercontent.com/6098197/91332638-5d47b780-e781-11ea-9fb6-4d134dbfc464.png" /></p>
<p>In the dialog, select "Remote Containers: Reopen in container"</p>
<p>VSCode will build the dockerfile inside of <code>.devcontainer</code> for you.  If you open a terminal inside VSCode (Terminal-&gt;New Terminal), you should see that your username has been changed to <code>ros</code>, and the bottom left green corner should say "Dev Container"</p>
<p><img alt="template_container" src="https://user-images.githubusercontent.com/6098197/91332895-adbf1500-e781-11ea-8afc-7a22a5340d4a.png" /></p>
<h3 id="update-the-template-with-your-code">Update the template with your code</h3>
<ol>
<li>Specify the repositories you want to include in your workspace in <code>src/ros2.repos</code> or delete <code>src/ros2.repos</code> and develop directly within the workspace.</li>
<li>If you are using a <code>ros2.repos</code> file, import the contents <code>Terminal-&gt;Run Task..-&gt;import from workspace file</code></li>
<li>Install dependencies <code>Terminal-&gt;Run Task..-&gt;install dependencies</code></li>
<li>(optional) Adjust scripts to your liking.  These scripts are used both within tasks and CI.</li>
<li><code>setup.sh</code> The setup commands for your code.  Default to import workspace and install dependencies.</li>
<li><code>build.sh</code> The build commands for your code.  Default to <code>--merge-install</code> and <code>--symlink-install</code></li>
<li><code>test.sh</code> The test commands for your code.</li>
<li>Develop!</li>
</ol>
<h2 id="faq">FAQ</h2>
<h3 id="wsl2">WSL2</h3>
<h4 id="the-gui-doesnt-show-up">The gui doesn't show up</h4>
<p>This is likely because the DISPLAY environment variable is not getting set properly.</p>
<ol>
<li>
<p>Find out what your DISPLAY variable should be</p>
<p>In your WSL2 Ubuntu instance</p>
<p><code>echo $DISPLAY</code></p>
</li>
<li>
<p>Copy that value into the <code>.devcontainer/devcontainer.json</code> file</p>
<p><code>jsonc
    "containerEnv": {
          "DISPLAY": ":0",
     }</code></p>
</li>
</ol>
<h4 id="i-want-to-use-vgpu">I want to use vGPU</h4>
<p>If you want to access the vGPU through WSL2, you'll need to add additional components to the <code>.devcontainer/devcontainer.json</code> file in accordance to <a href="https://github.com/microsoft/wslg/blob/main/samples/container/Containers.md">these directions</a></p>
<pre><code class="language-jsonc">    &quot;runArgs&quot;: [
        &quot;--network=host&quot;,
        &quot;--cap-add=SYS_PTRACE&quot;,
        &quot;--security-opt=seccomp:unconfined&quot;,
        &quot;--security-opt=apparmor:unconfined&quot;,
        &quot;--volume=/tmp/.X11-unix:/tmp/.X11-unix&quot;,
        &quot;--volume=/mnt/wslg:/mnt/wslg&quot;,
        &quot;--volume=/usr/lib/wsl:/usr/lib/wsl&quot;,
        &quot;--device=/dev/dxg&quot;,
            &quot;--gpus=all&quot;
    ],
    &quot;containerEnv&quot;: {
        &quot;DISPLAY&quot;: &quot;${localEnv:DISPLAY}&quot;, // Needed for GUI try &quot;:0&quot; for windows
        &quot;WAYLAND_DISPLAY&quot;: &quot;${localEnv:WAYLAND_DISPLAY}&quot;,
        &quot;XDG_RUNTIME_DIR&quot;: &quot;${localEnv:XDG_RUNTIME_DIR}&quot;,
        &quot;PULSE_SERVER&quot;: &quot;${localEnv:PULSE_SERVER}&quot;,
        &quot;LD_LIBRARY_PATH&quot;: &quot;/usr/lib/wsl/lib&quot;,
        &quot;LIBGL_ALWAYS_SOFTWARE&quot;: &quot;1&quot; // Needed for software rendering of opengl
    },
</code></pre>





                
              </article>
            </div>
          
          
        </div>
        
      </main>
      
        <footer class="md-footer">
  
  <div class="md-footer-meta md-typeset">
    <div class="md-footer-meta__inner md-grid">
      <div class="md-copyright">
  
  
    Made with
    <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
      Material for MkDocs
    </a>
  
</div>
      
    </div>
  </div>
</footer>
      
    </div>
    <div class="md-dialog" data-md-component="dialog">
      <div class="md-dialog__inner md-typeset"></div>
    </div>
    
    <script id="__config" type="application/json">{"base": ".", "features": [], "search": "assets/javascripts/workers/search.74e28a9f.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script>
    
    
      <script src="assets/javascripts/bundle.220ee61c.min.js"></script>
      
    
  </body>
</html>